package com.yss.reportworld.domain.rule;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.yss.common.core.annotation.EasyExcel;
import com.yss.common.core.annotation.ExcelValid;
import com.yss.common.core.utils.easyexecl.IntegerConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 数据源配置_校验对象对象 rw_db_r_check_object
 *
 * @author yss
 * @date 2023-07-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("rw_db_r_check_object")
public class RCheckObject extends Model<RCheckObject> {
    public static final String SHEET_NAME = "注册校验对象";
    /**
     * ID
     */
    @ExcelIgnore
    @TableId("ID")
    private String id;


    /**
     * 规则分类表ID_外键
     */
    @ExcelProperty({"校验对象", "分类"})
    @ColumnWidth(30)
    @TableField("RULE_TYPE_ID")
    @ExcelValid(message = "【注册校验对象】【校验对象】【分类】不能为空")
    private String ruleTypeId;
    /**
     * 校验类型(关系型数据库、文件、服务)
     */
    @ExcelProperty(value = {"校验对象", "类型"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "1=DB数据库服务,2=文件服务,3=API服务")
    @ColumnWidth(15)
    @TableField("TYPES")
    @ExcelValid(message = "【注册校验对象】【校验对象】【类型】不能为空")
    private Integer types;
    /**
     * 校验识别码(唯一值)
     */
    @ExcelProperty({"校验对象", "校验对象(唯一值)"})
    @ColumnWidth(15)
    @TableField("CHECK_CODE")
    @ExcelValid(message = "【注册校验对象】【校验对象】【校验对象(唯一值)】不能为空")
    private String checkCode;

    /**
     * 数据库引用表ID_外键
     */
    @ExcelProperty({"校验对象", "引用表名"})
    @ColumnWidth(20)
    @TableField("SOURCE_TABLE_ID")
    @ExcelValid(message = "【注册校验对象】【校验对象】【引用表名】不能为空")
    private String sourceTableId;

    @ExcelProperty({"校验对象", "引用表中文名"})
    @ColumnWidth(20)
    @TableField(exist = false)
    private String sourceTableName;

    /**
     * 描述
     */
    @ExcelProperty({"校验对象", "校验对象描述"})
    @ColumnWidth(20)
    @TableField("DESCRIBES")
    @ExcelValid(message = "【注册校验对象】【校验对象】【校验对象描述】不能为空")
    private String describes;

    /**
     * SQL
     */
    @ExcelProperty({"校验对象", "SQL"})
    @ColumnWidth(30)
    @TableField("SQL_STATEMENT")
    @ExcelValid(message = "校验对象校验SQL不能为空")
    private String sqlStatement;

    @ExcelProperty(value = {"校验对象", "检验对象类型"}, converter = IntegerConverter.class)
    @EasyExcel(readConverterExp = "0=单校验对象,1=关联校验对象")
    @ColumnWidth(15)
    @TableField("SUB_TYPE")
    @ExcelValid(message = "【注册校验对象】【校验对象】【校验检验对象类型】不能为空")
    private Integer subType;
    /**
     * 数据源管理标识_外键
     */
    @ExcelIgnore
    @TableField("SOURCE_CODE")
    private String sourceCode;

    /**
     * 参数分类ID
     */
    @ExcelIgnore
    @TableField("PARAMETER_IDS")
    private String parameterIds;

    /**
     * 常量分类ID
     */
    @ExcelIgnore
    @TableField("CONSTANT_IDS")
    private String constantIds;

    /**
     * 启停状态 0 启用   1 停用
     */
    @ExcelIgnore
    @TableField("RUN_FLAG")
    private Long runFlag;

    /**
     * 创建人
     */
    @ExcelIgnore
    @TableField("CREATE_USER")
    private String createUser;

    /**
     * 修改人
     */
    @ExcelIgnore
    @TableField("UPDATE_USER")
    private String updateUser;

    /**
     * 状态(逻辑删除状态)
     */
    @ExcelIgnore
    @TableField("STATUS")
    private Integer status;

    @ExcelIgnore
    @TableField(exist = false)
    private List<String> ids;

    @ExcelIgnore
    @TableField(exist = false)
    private String hisVersion;

    @ExcelIgnore
    @TableField(exist = false)
    private String dataBaseType;
    //导出方式
    @ExcelIgnore
    @TableField(exist = false)
    private Integer exportType;


    /**
     * 数据库类型
     */
    @ExcelIgnore
    @TableField("RW_DB_DATABASE_TYPE")
    private String rwDbDatabaseType;

    @ExcelIgnore
    @TableField(exist = false)
    private String customerId;
    /**
     * 数据编码
     */
    @ExcelIgnore
    @TableField("RW_DB_ID")
    private String rwDbId;
}
